

inputFocus('.main input');
inputFocus('.site-window input,textarea');





//1.省市区三级级联
$('.edit-content .select').data('off',true);
function select_citydata(sel){
	var $select_wrap = $('.edit-content '+sel),
		$select_input = $('.edit-content  input'),
		$select_list = $('.edit-content '+sel+' .select_list'),
		$select_li = $('.edit-content '+sel+' .li');
	$select_wrap.click(function(e){
		var _this = $(this),
			thisid = $(this).index('.edit-content .select');
		var selectOff = _this.data('off');
		
		
		//收起其他下拉选择
		var $select = $('.edit-content .select');
		for(var i = 0;i<$select.length;i++){
			if(i != thisid){
				if(!$select.eq(i).data('off')){
					$select.eq(i).removeClass('active')
						.data('off',true);
					$select.eq(i).find('.select_list').slideUp();
				}
			}
		}
		
		if(selectOff){
			$(this).addClass('active');
			$(this).find('.select_list').slideDown();
			
			if($select_li.length>=4){
				scroll('.edit-content '+sel+' .select_list');
			}
			
			_this.data('off',false);
		}else{
			$(this).removeClass('active');
			$(this).find('.select_list').slideUp();
			_this.data('off',true);
		}
		e.stopPropagation();
	});
	
	//选中下拉列表中选项
	$select_li.click(function(e){
		//标记选中
		$select_li.removeClass('selected');
		$(this).addClass('selected');
		
		$(this).parent().parent().removeClass('active');
		$(this).parent().parent().find('input').val($(this).text());
		
		$(this).parent().slideUp();
		$(this).parent().parent().data('off',true);
		e.stopPropagation();
	});
	
	
	//收起下拉列表
	$(document).click(function(){
		$select_list.slideUp();
		$select_wrap.removeClass('active');
		$select_wrap.data('off',true);
	});
	$(document).scroll(function(){
		$select_list.slideUp();
		$select_wrap.removeClass('active');
		$select_wrap.data('off',true);
	});
}

//2.
select_citydata('.select-pnum');




//3.日期控件
if($("#company-time").length > 0){
	$("#company-time").jeDate({
		minDate: '1970-1-1',
		maxDate: $.nowDate(),
		format: "YYYY-MM-DD",
	});
}



